#! /usr/bin/env python

PACKAGE='lsd_slam_core'
import roslib; roslib.load_manifest(PACKAGE)

#from driver_base.msg import SensorLevels
from dynamic_reconfigure.parameter_generator import *

gen = ParameterGenerator()

# actual algorithm parameters

gen.add("minUseGrad", double_t, 0, "Minimal Absolut Image Gradient for a Pixel to be used at all. Increase, if your camera has large image noise, Decrease if you have low image-noise and want to also exploit small gradients.", 5, 1, 50)
gen.add("cameraPixelNoise", double_t, 0, "Image intensity noise used for e.g. tracking weight calculation. Sould be set larger than the actual sensor-noise, to also account for noise originating from discretization / linear interpolation.", 4, 1, 50)

gen.add("KFUsageWeight", double_t, 0, "Determines how often Keyframes are taken, depending on the Overlap to the current Keyframe. Larger -> more Keyframes.", 4.0, 0.0, 20)
gen.add("KFDistWeight", double_t, 0, "Determines how often Keyframes are taken, depending on the Distance to the current Keyframe. Larger -> more Keyframes.", 3.0, 0.0, 20)

gen.add("doSLAM", bool_t, 0, "Toggle Global Mapping Component on/off. Only takes effect after a reset.", True)
gen.add("doKFReActivation", bool_t, 0, "Toggle Keyframe Re-Activation on/off: If close to an existing keyframe, re-activate it instead of creating a new one. If false, Map will continually grow even if the camera moves in a relatively constrained area; If false, the number of keyframes will not grow arbitrarily.", True)
gen.add("doMapping", bool_t, 0, "Toggle entire Keyframe Creating / Update module on/off: If false, only the Tracking Component stays active, which will prevent rapid motion or moving objects from corrupting the map.", True)
gen.add("useFabMap", bool_t, 0, "Use OpenFABMAP to find large loop-closures. Only takes effect after a reset, and requires LSD-SLAM to be compiled with FabMap.", False)


gen.add("allowNegativeIdepths", bool_t, 0, "Allow idepth to be (slightle) negative, to avoid introducing a bias for far-away points.", True)
gen.add("useSubpixelStereo", bool_t, 0, "Compute subpixel-accurate stereo disparity.", True)
gen.add("useAffineLightningEstimation", bool_t, 0, "EXPERIMENTAL: Correct for global affine intensity changes during tracking. Might help if you have Problems with Auto-Exposure.", False)
gen.add("multiThreading", bool_t, 0, "Toggle Multi-Threading of DepthMap Estimation. Disable for less CPU usage, but possibly slightly less quality.", True)

gen.add("maxLoopClosureCandidates", int_t, 0, "Maximal of Loop-Closures that are tracked initially for each new keyframe.", 10, 0, 50)
gen.add("loopclosureStrictness", double_t, 0, "Threshold on reciprocal loop-closure consistency check, to be added to the map. Larger -> more (possibly wrong) Loopclosures.", 1.5, 0.0, 100)
gen.add("relocalizationTH", double_t, 0, "How good a relocalization-attempt has to be, to be accepted. Larger -> More Strict.", 0.7, 0, 1)

gen.add("depthSmoothingFactor", double_t, 0, "How much to smooth the depth map. Larger -> Less Smoothing", 1, 0, 10)




exit(gen.generate(PACKAGE, "Config", "LSDParams"))

